home *** CD-ROM | disk | FTP | other *** search
/ Info-Mac 4 / Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso / Development / Source / Telnet 2.6.1d1 4⁄26⁄94 Folder / Krb / encrypt.h < prev    next >
C/C++ Source or Header  |  1993-10-11  |  3KB  |  93 lines

  1. #pragma once
  2.  
  3. /*-
  4.  * Copyright (c) 1991 The Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted provided
  8.  * that: (1) source distributions retain this entire copyright notice and
  9.  * comment, and (2) distributions including binaries display the following
  10.  * acknowledgement:  ``This product includes software developed by the
  11.  * University of California, Berkeley and its contributors'' in the
  12.  * documentation or other materials provided with the distribution and in
  13.  * all advertising materials mentioning features or use of this software.
  14.  * Neither the name of the University nor the names of its contributors may
  15.  * be used to endorse or promote products derived from this software without
  16.  * specific prior written permission.
  17.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  18.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  19.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  *    @(#)encrypt.h    5.1 (Berkeley) 2/28/91
  22.  */
  23.  
  24. /*
  25.  * Copyright (C) 1990 by the Massachusetts Institute of Technology
  26.  *
  27.  * Export of this software from the United States of America is assumed
  28.  * to require a specific license from the United States Government.
  29.  * It is the responsibility of any person or organization contemplating
  30.  * export to obtain such a license before exporting.
  31.  *
  32.  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
  33.  * distribute this software and its documentation for any purpose and
  34.  * without fee is hereby granted, provided that the above copyright
  35.  * notice appear in all copies and that both that copyright notice and
  36.  * this permission notice appear in supporting documentation, and that
  37.  * the name of M.I.T. not be used in advertising or publicity pertaining
  38.  * to distribution of the software without specific, written prior
  39.  * permission.  M.I.T. makes no representations about the suitability of
  40.  * this software for any purpose.  It is provided "as is" without express
  41.  * or implied warranty.
  42.  */
  43.  
  44. #ifndef    __ENCRYPT__
  45. #define    __ENCRYPT__
  46.  
  47. #define    DIR_DECRYPT        1
  48. #define    DIR_ENCRYPT        2
  49.  
  50. typedef    unsigned char Block[8];
  51. typedef unsigned char *BlockT;
  52. typedef struct { Block _; } Schedule[16];
  53.  
  54. #define    VALIDKEY(key)    ( key[0] | key[1] | key[2] | key[3] | \
  55.               key[4] | key[5] | key[6] | key[7])
  56.  
  57. #define    SAMEKEY(k1, k2)    (!bcmp((void *)k1, (void *)k2, sizeof(Block)))
  58.  
  59. typedef    struct {
  60.     short        type;
  61.     long        length;
  62.     unsigned char    *data;
  63. } Session_Key;
  64.  
  65. #define P(x)    x
  66.  
  67. typedef struct {
  68.     char *name;
  69.     long    type;
  70.     void (*output) (void *, unsigned char *, long);
  71.     long    (*input) (void *, long);
  72.     void (*init) (void *, long);
  73.     long    (*start) (void *, long, long);
  74.     long    (*is) (void *, unsigned char *, long);
  75.     long    (*reply) (void *, unsigned char *, long);
  76.     void (*session) (void *, Session_Key *, long);
  77.     long    (*keyid) (void *, long, unsigned char *, long *);
  78.     void (*printsub) (unsigned char *, long, unsigned char *, long);
  79. } Encryptions;
  80.  
  81. #define    SK_DES        1    /* Matched Kerberos v5 KEYTYPE_DES */
  82.  
  83. extern long encrypt_debug_mode;
  84.  
  85. #ifdef notdef
  86. extern long (*decrypt_input) P((long));
  87. extern void (*encrypt_output) P((unsigned char *, long));
  88. #endif
  89. #endif
  90.  
  91. #define ENCTYPE_DES_CFB64    1
  92. #define ENCTYPE_DES_OFB64    2
  93.